<template>
	<view class="news">
		<news-item @itemClick="goDetail" :list="newsList"></news-item>
	</view>
</template>

<script>
	import newsItem from '../../components/news-item/news-item.vue'
	export default {
		data() {
			return {
				newsList: [],
				list: {
					  "status":0,
						"message":[
						  {"id":13,
						   "title":"1季度多家房企利润跌幅超50% 去库存促销战打响",
						   "add_time":"2015-04-16T03:50:28.000Z",
						   "zhaiyao":"房企一季度销售业绩已经陆续公布，克而瑞研究中心统计",
						   "click":1,
						   "img_url":"/static/logo.png"
						  }
						]
					}

			}
		},
		methods: {
			async getNews () {
				// const res = await this.$myRuquest({
				// 	url: '/api/getnewslist'
				// })
				const res = this.list
				this.newsList = res.message
				for (var i = 0; i < 16; i++) {
					this.newsList = this.newsList.concat(res.message)
				}
			},
			goDetail (id) {
				uni.navigateTo({
					// url: '/pages/news-detail/news-detail?id='+id
					url: '/pages/news-deail/news-deail'
				})
			}
		},
		components: {"news-item":newsItem},
		onLoad () {
			this.getNews()
		}
	}
</script>

<style lang="scss">
	.news {
		
	}
</style>
